<?php
/*!
* TalkBack basic-client index page
* This file shows how to use the TalkBack library to implement the auto-discovery mechanism. 
* @Author: Elie Bursztein (elie _AT_ cs.stanford.edu)
* @version: 1.0
* @url: http://talkback.stanford.edu
* @Licence: LGPL
*/
?>
<html>
	<head>
		<title>TalBack basic client</title>
		<?
		
			require_once "config.php"; 				//configuration file
			require_once "../library/talkback.php";	//the talkback cslient library 

			//creating an instance of the lib
			$tb = new TalkBack($dataDir, $debug);
			
			//loading data	(we don't load the private key as we don't need it and therefore limit its exposure)		
			if ($tb->load(FALSE)) {
				$msg = "Your client should be ready to use. got to the <a href=\"post.php\">post page</a> to start posting";
			} else {
				$msg ="To use this client you need to first to <a href=\"registration.php\">Register it</a>.";
			}
			
			//creating headers
			?>
			<meta http-equiv=TalkBack-Id" content="<?php print $tb->getRandString(); ?>" />
			<link rel="talkback-notification/both>"  href="/notifyme.php?id=1">
			<link rel="talkback-crypto/<?php print $tb->getCryptoSuite();?>"  href="/publickey.php">
			
	</head>
	<body>
		<h2>About</h2>
		This is a basic client for the TalkBack protocol. For more information go to:
		<a href="http://talkback.stanford.edu">https://talkback.stanford.edu</a> <br/>
		
		<h2>Status</h2>
		<?php print $msg ?>
		
		<h2>Received Notification</h2>
		
	</body>
</html>